package com.yyy.controller;


import com.yyy.service.TicketInfoService;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

@Controller
@RequestMapping(value = "ticketInfo")
public class TicketInfoController {


    @Resource
    private TicketInfoService ticketInfoService;

    @GetMapping(path = "/list")
    @ResponseBody
    public Object getAllUsers(final int page, final int pageSize) {
        final Pageable pageable = PageRequest.of(page, pageSize);
        return ticketInfoService.getTicketList(null, pageable).getContent();
    }


}
